unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TDbObjClass = class of TDbObj;

  TDbObj=class(TObject)

  end;

  TCust = class(TDbObj)
  public
    CustIdex:Integer;
    CustName:string;
  end;

  TProd = class(TDbObj)
    ProdIdex:Integer;
    ProdName:string;
  end;

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    function CreateObj(ADbObjClass:TDbObjClass):TDbObj;
  end;


var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
var
  ObjA:TDbObj;
begin
  ObjA:=CreateObj(TCust);

  ShowMessage(IntToStr(TCust(ObjA).CustIdex));
  ShowMessage(TCust(ObjA).CustName);
end;

function TForm1.CreateObj(ADbObjClass: TDbObjClass): TDbObj;
begin
  //



end;

end.
